//引入express模块创建服务器
const express = require('express');
//创建路由
const router = express.Router();
//引入Ctrl
const ctrl = require('../ctrl/controller.js');

//注册页面渲染
router.get('/register', ctrl.showRegister);
//登录页面渲染
router.get('/login', ctrl.showLogin);

//监听注册提交请求
router.post('/register', ctrl.register);

//监听登录请求
router.post('/login',ctrl.login);

//监听退出登录请求
router.get('/loginout',ctrl.loginout);
//导出router
module.exports = router;